﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Utils.Common
{

    [Serializable]
    public class ConfigBase
    {
        //private static string root = System.Environment.CurrentDirectory;
        private static string root = System.Windows.Forms.Application.StartupPath;
        private static string config = "Config";
        private static string info= "Info";
        private static string debug = "Debug";
        private static string error = "Error";


        

        public static readonly string FromatString = @"{0}\{1}\{2}.dat";


 
 
        //public static string TempModel = Temp ;

        protected ConfigBase()
        {

        }

        public static string Root
        {
            get { return root; }

        }

        public static string Config
        {
            get
            {
                string directoryName = string.Format(@"{0}\{1}", ConfigBase.Root, config);
                if (!Directory.Exists(directoryName))
                {
                    Directory.CreateDirectory(directoryName);
                }
                return config;
            }
            set
            {
                config = value;

            }
        }


        public static string Info
        {
            get
            {
                string directoryName = string.Format(@"{0}\{1}\{2}", ConfigBase.Root,"Log" , info);
                if (!Directory.Exists(directoryName))
                {
                    Directory.CreateDirectory(directoryName);
                }
                return directoryName;
            }
          
        }


        public static string Debug
        {
            get
            {
                string directoryName = string.Format(@"{0}\{1}\{2}", ConfigBase.Root, "Log", debug);
                if (!Directory.Exists(directoryName))
                {
                    Directory.CreateDirectory(directoryName);
                }
                return directoryName;
            }
           
        }


        public static string Error
        {
            get
            {
                string directoryName = string.Format(@"{0}\{1}\{2}", ConfigBase.Root, "Log", error);
                if (!Directory.Exists(directoryName))
                {
                    Directory.CreateDirectory(directoryName);
                }
                return directoryName;
            }
          
        }

        public static string LogoImg
        {
            get
            {
                string directoryName = string.Format(@"{0}\{1}", ConfigBase.Root, "LogoImg");
                if (!Directory.Exists(directoryName))
                {
                    Directory.CreateDirectory(directoryName);
                }
                return directoryName;
            }
        }



        //public static string XML
        //{
        //    get
        //    {
        //        string directoryName = string.Format(@"{0}\{1}", ConfigBase.Root, xml);
        //        if (!Directory.Exists(directoryName))
        //        {
        //            Directory.CreateDirectory(directoryName);
        //        }
        //        return directoryName;
        //    }

        //}

        //public static string NGImg
        //{
        //    get
        //    {
        //        string directoryName = string.Format(@"{0}\{1}", ConfigBase.Root, ngimg);
        //        if (!Directory.Exists(directoryName))
        //        {
        //            Directory.CreateDirectory(directoryName);
        //        }
        //        return directoryName;
        //    }

        //}

        //private static string Temp
        //{
        //    get
        //    {
        //        string directoryName = string.Format(@"{0}\{1}", ConfigBase.Root, temp);
        //        if (!Directory.Exists(directoryName))
        //        {
        //            Directory.CreateDirectory(directoryName);
        //        }
        //        return directoryName;
        //    }
        //}


        //public static string MatchingModel
        //{
        //    get
        //    {
        //        string directoryName = string.Format(@"{0}\{1}", ConfigBase.Root, matchingmodel);
        //        if (!Directory.Exists(directoryName))
        //        {
        //            Directory.CreateDirectory(directoryName);
        //        }
        //        return directoryName;
        //    }

        //}

    }
}


